<?php
	require_once('./template/header.tpl.php');
	include_once('./src/config.php');
	include_once('./src/connect.php');

	session_start();
	$username = $_SESSION['username'];

	$query = "SELECT * FROM ark_mytable WHERE uid='$username' ORDER BY weekday, dayfrom";
	if ($result = mysql_query($query, $link)) {
		while ($res = mysql_fetch_array($result)) {
			print "<div id='box'><ul>"
				."<li>课程名称：".$res['coursename']."</li>"
				."<li>任课教师：".$res['teacher']."</li>"
				."<li>上课地点：".$res['campus'].$res['building'].$res['room']."</li>"
				."<li>上课时间：".$weekday[$res['weekday']].">>>".$dayfrom[$res['dayfrom']]." <-> ".$dayto[$res['dayto']]."</li>"
				."<li><a href='delete_class.php?m_id={$res['m_id']}'>删除课程</a></li>"
				."</ul></div>";
		}
	}

	require_once('./template/footer.tpl.php');
?>